<template>
<div class="home">
<!-- 头部组件 -->
<home-header></home-header>
<!-- 轮播组件 -->
<home-swiper :slist="swiperList"></home-swiper>
<!-- 景点组件 -->
<home-scenic :clist="scenicList"></home-scenic>
<!-- 本周热单组件 -->
<home-hotweek :hlist="hotList"></home-hotweek>
<!-- 猜你喜欢组件 -->
<home-guesslove :GuessloveList="GuessloveList"></home-guesslove>
<!-- 周末去哪儿组件 -->
<home-weekend :list="weekendlist"></home-weekend>
</div>
</template>

<script>
import HomeHeader from './home/components/Header.vue'
import HomeSwiper from './home/components/Swiper.vue'
import HomeScenic from './home/components/Scenic.vue'
import HomeHotweek from './home/components/Hotweek.vue'
import HomeGuesslove from './home/components/Guesslove.vue'
import HomeWeekend from './home/components/Weekend.vue'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    HomeHeader,
    HomeSwiper,
    HomeScenic,
    HomeHotweek,
    HomeGuesslove,
    HomeWeekend
  },
  data () {
    return {
      swiperList: [],
      scenicList: [],
      hotList: [],
      GuessloveList: [],
      weekendlist: []
    }
  },
  mounted () {
    axios.get('/localdata/index.json')
      .then((res) => {
        let dataObj = res.data
        let dataList = dataObj.data
        if (dataObj.ret && dataList) {
          this.swiperList = dataList.swiperList
          this.scenicList = dataList.scenicList
          this.hotList = dataList.hotList
          this.GuessloveList = dataList.GuessloveList
          this.weekendlist = dataList.weekendlist
        }
      })
  }
}
</script>
